@echo off
IF "%1" == "" GOTO error_bf

set BUILD_FLAVOR=%1
set PROJECT_ROOT=..
set OUTDIR=%PROJECT_ROOT%\out\%BUILD_FLAVOR%

mkdir "%PROJECT_ROOT%\out"
mkdir "%OUTDIR%"
mkdir "%OUTDIR%\media"
mkdir "%OUTDIR%\media\materials"
mkdir "%OUTDIR%\media\packs"
mkdir "%OUTDIR%\media\ui"
mkdir "%OUTDIR%\media\meshes"
mkdir "%OUTDIR%\media\sounds"
mkdir "%OUTDIR%\media\fonts"
mkdir "%OUTDIR%\media\xaml"
mkdir "%OUTDIR%\media\ships"
mkdir "%OUTDIR%\media\ships\fed"
mkdir "%OUTDIR%\media\ships\kli"
mkdir "%OUTDIR%\media\ships\ori"
mkdir "%OUTDIR%\media\ships\rom"
mkdir "%OUTDIR%\media\ships\ind"

xcopy /D /s /Y %PROJECT_ROOT%\NetrekClient\Media\Materials %OUTDIR%\Media\Materials
xcopy /D /s /Y %PROJECT_ROOT%\NetrekClient\Media\UI %OUTDIR%\Media\UI
xcopy /D /s /Y %PROJECT_ROOT%\NetrekClient\Media\Sounds %OUTDIR%\Media\Sounds
xcopy /D /s /Y %PROJECT_ROOT%\NetrekClient\Media\packs %OUTDIR%\Media\packs
xcopy /D /s /Y %PROJECT_ROOT%\NetrekClient\Media\Fonts %OUTDIR%\Media\Fonts
xcopy /D /s /Y %PROJECT_ROOT%\NetrekClient\BlendProject\NetrekUI\*.xaml %OUTDIR%\Media\Xaml

xcopy /D %PROJECT_ROOT%\Dependencies\Runtime\%BUILD_FLAVOR%\* %OUTDIR%

Tools\OgreXMLConverter.exe -e -r Media\Ships\Fed\Fed-Assault.mesh.xml %OUTDIR%\Media\Ships\Fed\Fed-Assault.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Fed\Fed-Battleship.mesh.xml %OUTDIR%\Media\Ships\Fed\Fed-Battleship.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Fed\Fed-Cruiser.mesh.xml %OUTDIR%\Media\Ships\Fed\Fed-Cruiser.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Fed\Fed-Destroyer.mesh.xml %OUTDIR%\Media\Ships\Fed\Fed-Destroyer.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Fed\Fed-Scout.mesh.xml %OUTDIR%\Media\Ships\Fed\Fed-Scout.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Fed\Fed-Starbase.mesh.xml %OUTDIR%\Media\Ships\Fed\Fed-Starbase.mesh

Tools\OgreXMLConverter.exe -e -r Media\Ships\Rom\Rom-Assault.mesh.xml %OUTDIR%\Media\Ships\Rom\Rom-Assault.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Rom\Rom-Battleship.mesh.xml %OUTDIR%\Media\Ships\Rom\Rom-Battleship.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Rom\Rom-Cruiser.mesh.xml %OUTDIR%\Media\Ships\Rom\Rom-Cruiser.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Rom\Rom-Destroyer.mesh.xml %OUTDIR%\Media\Ships\Rom\Rom-Destroyer.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Rom\Rom-Scout.mesh.xml %OUTDIR%\Media\Ships\Rom\Rom-Scout.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Rom\Rom-Starbase.mesh.xml %OUTDIR%\Media\Ships\Rom\Rom-Starbase.mesh

Tools\OgreXMLConverter.exe -e -r Media\Ships\Kli\Kli-Assault.mesh.xml %OUTDIR%\Media\Ships\Kli\Kli-Assault.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Kli\Kli-Battleship.mesh.xml %OUTDIR%\Media\Ships\Kli\Kli-Battleship.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Kli\Kli-Cruiser.mesh.xml %OUTDIR%\Media\Ships\Kli\Kli-Cruiser.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Kli\Kli-Destroyer.mesh.xml %OUTDIR%\Media\Ships\Kli\Kli-Destroyer.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Kli\Kli-Scout.mesh.xml %OUTDIR%\Media\Ships\Kli\Kli-Scout.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Kli\Kli-Starbase.mesh.xml %OUTDIR%\Media\Ships\Kli\Kli-Starbase.mesh

Tools\OgreXMLConverter.exe -e -r Media\Ships\Ori\Ori-Assault.mesh.xml %OUTDIR%\Media\Ships\Ori\Ori-Assault.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Ori\Ori-Battleship.mesh.xml %OUTDIR%\Media\Ships\Ori\Ori-Battleship.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Ori\Ori-Cruiser.mesh.xml %OUTDIR%\Media\Ships\Ori\Ori-Cruiser.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Ori\Ori-Destroyer.mesh.xml %OUTDIR%\Media\Ships\Ori\Ori-Destroyer.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Ori\Ori-Scout.mesh.xml %OUTDIR%\Media\Ships\Ori\Ori-Scout.mesh
Tools\OgreXMLConverter.exe -e -r Media\Ships\Ori\Ori-Starbase.mesh.xml %OUTDIR%\Media\Ships\Ori\Ori-Starbase.mesh

Tools\OgreXMLConverter.exe -e -r Media\Ships\Ind\Ind-Cruiser.mesh.xml %OUTDIR%\Media\Ships\Ind\Ind-Cruiser.mesh

Tools\OgreXMLConverter.exe -e -r Media\Meshes\UnitSphere.mesh.xml %OUTDIR%\Media\Meshes\UnitSphere.mesh
Tools\OgreXMLConverter.exe -e -r Media\Meshes\UnitPyramid.mesh.xml %OUTDIR%\Media\Meshes\UnitPyramid.mesh
	
goto done

:error_bf
@echo Usage: BuildArt Debug^|Release

:done


